
layui.use(['layer','laydate'], function(){
    componentSelectInit(
        {
            ctxPath:'',
            tableName:"wn_farm",
            showValueField:"name",
            valueField:"id",
            selectId:"farmId"  ,
            where:""
        }
        ,function(){
        });
});

var wnMachineToolConsoleGrid =new consoleGrid({table_id:"wnMachineTool"});
wnMachineToolConsoleGrid.init();
function wnMachineToolTableOperate(value){
return "<button type='button' class='btn btn-xs btn-default command-edit' onclick='consoleOpenWindow(\"wnMachineTool\",\"/console/wn_machine_tool/edit?id="+value+"\",\"编辑\")'><span class='glyphicon glyphicon-pencil'></span></button> ";
}
function wnMachineToolLoadParam(params){
params.query=wnMachineToolQueryString();
return params;
}
function wnMachineToolQueryString() {
var objQuery = new Object();
    objQuery.name=$('#name').val()==''?null:$('#name').val(); 
     objQuery.toolNumber=$('#toolNumber').val()==''?null:$('#toolNumber').val(); 
     objQuery.buyTime=$('#buyTime').val()==''?null:$('#buyTime').val(); 
     objQuery.brand=$('#brand').val()==''?null:$('#brand').val(); 
     objQuery.breadth=$('#breadth').val()==''?null:$('#breadth').val(); 
     objQuery.type=$('#type').val()==''?null:$('#type').val(); 
     objQuery.farmId=$('#farmId').val()==''?null:$('#farmId').val(); 
 
var queryString = JSON.stringify(objQuery);
return queryString;
}

